how to convert string to class object in c